package com.metagurukul.metaspace.controller;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class StatusUpdateForm extends ActionForm {

	/**
	 * 
	 */
	private String status;
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	private static final long serialVersionUID = 1L;
	public  ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
		
		ActionErrors errors = new ActionErrors();
		if(status.equals("")) {
			errors.add("statusErr", new ActionMessage("com.metagurukul.metaspace.status.required"));
		}
		if(status.length() > 400) {
			errors.add("statusErr", new ActionMessage("com.metagurukul.metaspace.status.statusError"));
		}
		return errors;		
	}
}
